import request from '@/utils/request'

// 查询渠道列表
export function listChannel(query) {
    return request({
        url: '/channel/platchannelinfo/list',
        method: 'get',
        params: query
    })
}

// 查询渠道详细
export function getChannel(id) {
    return request({
        url: '/channel/platchannelinfo/' + id,
        method: 'get'
    })
}

// 新增渠道
export function addChannel(data) {
    return request({
        url: '/channel/platchannelinfo',
        method: 'post',
        data: data
    })
}

// 修改渠道
export function updateChannel(data) {
    return request({
        url: '/channel/platchannelinfo',
        method: 'put',
        data: data
    })
}

// 删除渠道
export function delChannel(id) {
    return request({
        url: '/channel/platchannelinfo/' + id,
        method: 'delete'
    })
}

//获取渠道支付配置数据
export function getPayConfig() {
    return request({
        url: '/channel/platchannelinfo/getPayConfig',
        method: 'post',
    })
}

//配置渠道
export function configChannel(data) {
    return request({
        url: '/channel/platchannelinfo/configChannel',
        method: 'post',
        data: data
    })
}

//sm2公私钥获取
export function sm2SecretGenerate() {
    return request({
        url: '/channel/platchannelinfo/getSm2Secret',
        method: 'post',
    })
}

//rsa公私钥获取
export function rsaSecretGenerate() {
    return request({
        url: '/channel/platchannelinfo/getRsaSecret',
        method: 'post',
    })
}
